{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "ed675970",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Polar\n",
    "\n",
    "import random\n",
    "from pyecharts.faker import Faker"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "bbb0b093",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[(0, 71),\n",
       " (1, 5),\n",
       " (2, 3),\n",
       " (3, 14),\n",
       " (4, 13),\n",
       " (5, 94),\n",
       " (6, 26),\n",
       " (7, 15),\n",
       " (8, 37),\n",
       " (9, 60),\n",
       " (10, 76),\n",
       " (11, 96),\n",
       " (12, 20),\n",
       " (13, 29),\n",
       " (14, 67),\n",
       " (15, 71),\n",
       " (16, 87),\n",
       " (17, 51),\n",
       " (18, 37),\n",
       " (19, 85),\n",
       " (20, 76),\n",
       " (21, 32),\n",
       " (22, 77),\n",
       " (23, 94),\n",
       " (24, 69),\n",
       " (25, 59),\n",
       " (26, 54),\n",
       " (27, 95),\n",
       " (28, 29),\n",
       " (29, 23),\n",
       " (30, 38),\n",
       " (31, 11),\n",
       " (32, 96),\n",
       " (33, 86),\n",
       " (34, 94),\n",
       " (35, 87),\n",
       " (36, 56),\n",
       " (37, 15),\n",
       " (38, 40),\n",
       " (39, 63),\n",
       " (40, 39),\n",
       " (41, 58),\n",
       " (42, 26),\n",
       " (43, 13),\n",
       " (44, 77),\n",
       " (45, 82),\n",
       " (46, 51),\n",
       " (47, 76),\n",
       " (48, 34),\n",
       " (49, 80),\n",
       " (50, 32),\n",
       " (51, 82),\n",
       " (52, 86),\n",
       " (53, 76),\n",
       " (54, 2),\n",
       " (55, 61),\n",
       " (56, 22),\n",
       " (57, 79),\n",
       " (58, 20),\n",
       " (59, 26),\n",
       " (60, 49),\n",
       " (61, 64),\n",
       " (62, 7),\n",
       " (63, 90),\n",
       " (64, 94),\n",
       " (65, 88),\n",
       " (66, 60),\n",
       " (67, 32),\n",
       " (68, 95),\n",
       " (69, 60),\n",
       " (70, 42),\n",
       " (71, 37),\n",
       " (72, 18),\n",
       " (73, 65),\n",
       " (74, 3),\n",
       " (75, 98),\n",
       " (76, 16),\n",
       " (77, 98),\n",
       " (78, 34),\n",
       " (79, 92),\n",
       " (80, 56),\n",
       " (81, 65),\n",
       " (82, 22),\n",
       " (83, 49),\n",
       " (84, 78),\n",
       " (85, 63),\n",
       " (86, 71),\n",
       " (87, 9),\n",
       " (88, 65),\n",
       " (89, 24),\n",
       " (90, 56),\n",
       " (91, 72),\n",
       " (92, 80),\n",
       " (93, 21),\n",
       " (94, 66),\n",
       " (95, 66),\n",
       " (96, 59),\n",
       " (97, 28),\n",
       " (98, 50),\n",
       " (99, 65),\n",
       " (100, 91)]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = [(i, random.randint(1, 100)) for i in range(101)]\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "f11e84c6",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"e5f6e70efe174f2fb29bb145fd749567\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_e5f6e70efe174f2fb29bb145fd749567 = echarts.init(\n",
       "                    document.getElementById('e5f6e70efe174f2fb29bb145fd749567'), 'white', {renderer: 'canvas'});\n",
       "                var option_e5f6e70efe174f2fb29bb145fd749567 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"\\u6781\\u5750\\u6807\",\n",
       "            \"coordinateSystem\": \"polar\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0,\n",
       "                    71\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    14\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    13\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    94\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    26\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    15\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    37\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    60\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    76\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    96\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    20\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    29\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    67\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    71\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    87\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    51\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    37\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    85\n",
       "                ],\n",
       "                [\n",
       "                    20,\n",
       "                    76\n",
       "                ],\n",
       "                [\n",
       "                    21,\n",
       "                    32\n",
       "                ],\n",
       "                [\n",
       "                    22,\n",
       "                    77\n",
       "                ],\n",
       "                [\n",
       "                    23,\n",
       "                    94\n",
       "                ],\n",
       "                [\n",
       "                    24,\n",
       "                    69\n",
       "                ],\n",
       "                [\n",
       "                    25,\n",
       "                    59\n",
       "                ],\n",
       "                [\n",
       "                    26,\n",
       "                    54\n",
       "                ],\n",
       "                [\n",
       "                    27,\n",
       "                    95\n",
       "                ],\n",
       "                [\n",
       "                    28,\n",
       "                    29\n",
       "                ],\n",
       "                [\n",
       "                    29,\n",
       "                    23\n",
       "                ],\n",
       "                [\n",
       "                    30,\n",
       "                    38\n",
       "                ],\n",
       "                [\n",
       "                    31,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    32,\n",
       "                    96\n",
       "                ],\n",
       "                [\n",
       "                    33,\n",
       "                    86\n",
       "                ],\n",
       "                [\n",
       "                    34,\n",
       "                    94\n",
       "                ],\n",
       "                [\n",
       "                    35,\n",
       "                    87\n",
       "                ],\n",
       "                [\n",
       "                    36,\n",
       "                    56\n",
       "                ],\n",
       "                [\n",
       "                    37,\n",
       "                    15\n",
       "                ],\n",
       "                [\n",
       "                    38,\n",
       "                    40\n",
       "                ],\n",
       "                [\n",
       "                    39,\n",
       "                    63\n",
       "                ],\n",
       "                [\n",
       "                    40,\n",
       "                    39\n",
       "                ],\n",
       "                [\n",
       "                    41,\n",
       "                    58\n",
       "                ],\n",
       "                [\n",
       "                    42,\n",
       "                    26\n",
       "                ],\n",
       "                [\n",
       "                    43,\n",
       "                    13\n",
       "                ],\n",
       "                [\n",
       "                    44,\n",
       "                    77\n",
       "                ],\n",
       "                [\n",
       "                    45,\n",
       "                    82\n",
       "                ],\n",
       "                [\n",
       "                    46,\n",
       "                    51\n",
       "                ],\n",
       "                [\n",
       "                    47,\n",
       "                    76\n",
       "                ],\n",
       "                [\n",
       "                    48,\n",
       "                    34\n",
       "                ],\n",
       "                [\n",
       "                    49,\n",
       "                    80\n",
       "                ],\n",
       "                [\n",
       "                    50,\n",
       "                    32\n",
       "                ],\n",
       "                [\n",
       "                    51,\n",
       "                    82\n",
       "                ],\n",
       "                [\n",
       "                    52,\n",
       "                    86\n",
       "                ],\n",
       "                [\n",
       "                    53,\n",
       "                    76\n",
       "                ],\n",
       "                [\n",
       "                    54,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    55,\n",
       "                    61\n",
       "                ],\n",
       "                [\n",
       "                    56,\n",
       "                    22\n",
       "                ],\n",
       "                [\n",
       "                    57,\n",
       "                    79\n",
       "                ],\n",
       "                [\n",
       "                    58,\n",
       "                    20\n",
       "                ],\n",
       "                [\n",
       "                    59,\n",
       "                    26\n",
       "                ],\n",
       "                [\n",
       "                    60,\n",
       "                    49\n",
       "                ],\n",
       "                [\n",
       "                    61,\n",
       "                    64\n",
       "                ],\n",
       "                [\n",
       "                    62,\n",
       "                    7\n",
       "                ],\n",
       "                [\n",
       "                    63,\n",
       "                    90\n",
       "                ],\n",
       "                [\n",
       "                    64,\n",
       "                    94\n",
       "                ],\n",
       "                [\n",
       "                    65,\n",
       "                    88\n",
       "                ],\n",
       "                [\n",
       "                    66,\n",
       "                    60\n",
       "                ],\n",
       "                [\n",
       "                    67,\n",
       "                    32\n",
       "                ],\n",
       "                [\n",
       "                    68,\n",
       "                    95\n",
       "                ],\n",
       "                [\n",
       "                    69,\n",
       "                    60\n",
       "                ],\n",
       "                [\n",
       "                    70,\n",
       "                    42\n",
       "                ],\n",
       "                [\n",
       "                    71,\n",
       "                    37\n",
       "                ],\n",
       "                [\n",
       "                    72,\n",
       "                    18\n",
       "                ],\n",
       "                [\n",
       "                    73,\n",
       "                    65\n",
       "                ],\n",
       "                [\n",
       "                    74,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    75,\n",
       "                    98\n",
       "                ],\n",
       "                [\n",
       "                    76,\n",
       "                    16\n",
       "                ],\n",
       "                [\n",
       "                    77,\n",
       "                    98\n",
       "                ],\n",
       "                [\n",
       "                    78,\n",
       "                    34\n",
       "                ],\n",
       "                [\n",
       "                    79,\n",
       "                    92\n",
       "                ],\n",
       "                [\n",
       "                    80,\n",
       "                    56\n",
       "                ],\n",
       "                [\n",
       "                    81,\n",
       "                    65\n",
       "                ],\n",
       "                [\n",
       "                    82,\n",
       "                    22\n",
       "                ],\n",
       "                [\n",
       "                    83,\n",
       "                    49\n",
       "                ],\n",
       "                [\n",
       "                    84,\n",
       "                    78\n",
       "                ],\n",
       "                [\n",
       "                    85,\n",
       "                    63\n",
       "                ],\n",
       "                [\n",
       "                    86,\n",
       "                    71\n",
       "                ],\n",
       "                [\n",
       "                    87,\n",
       "                    9\n",
       "                ],\n",
       "                [\n",
       "                    88,\n",
       "                    65\n",
       "                ],\n",
       "                [\n",
       "                    89,\n",
       "                    24\n",
       "                ],\n",
       "                [\n",
       "                    90,\n",
       "                    56\n",
       "                ],\n",
       "                [\n",
       "                    91,\n",
       "                    72\n",
       "                ],\n",
       "                [\n",
       "                    92,\n",
       "                    80\n",
       "                ],\n",
       "                [\n",
       "                    93,\n",
       "                    21\n",
       "                ],\n",
       "                [\n",
       "                    94,\n",
       "                    66\n",
       "                ],\n",
       "                [\n",
       "                    95,\n",
       "                    66\n",
       "                ],\n",
       "                [\n",
       "                    96,\n",
       "                    59\n",
       "                ],\n",
       "                [\n",
       "                    97,\n",
       "                    28\n",
       "                ],\n",
       "                [\n",
       "                    98,\n",
       "                    50\n",
       "                ],\n",
       "                [\n",
       "                    99,\n",
       "                    65\n",
       "                ],\n",
       "                [\n",
       "                    100,\n",
       "                    91\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u6781\\u5750\\u6807\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u6781\\u5750\\u6807\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"radiusAxis\": {\n",
       "        \"scale\": false\n",
       "    },\n",
       "    \"angleAxis\": {\n",
       "        \"clockwise\": false,\n",
       "        \"scale\": false,\n",
       "        \"splitNumber\": 5\n",
       "    },\n",
       "    \"polar\": {},\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u6781\\u5750\\u6807\\u56fe\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_e5f6e70efe174f2fb29bb145fd749567.setOption(option_e5f6e70efe174f2fb29bb145fd749567);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1a448692220>"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = (\n",
    "    Polar()\n",
    "    .add(\n",
    "        '极坐标',\n",
    "        data,\n",
    "        type_='scatter',  # 散点图\n",
    "        label_opts=opts.LabelOpts(is_show=False)\n",
    "    )\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title='极坐标图'))\n",
    ")\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "4bf30df7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['周一', '周二', '周三', '周四', '周五', '周六', '周日']"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Faker.week"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "297f88d6",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"3204203e56414e738a532e91304afbfa\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_3204203e56414e738a532e91304afbfa = echarts.init(\n",
       "                    document.getElementById('3204203e56414e738a532e91304afbfa'), 'white', {renderer: 'canvas'});\n",
       "                var option_3204203e56414e738a532e91304afbfa = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5546\\u54c1\",\n",
       "            \"coordinateSystem\": \"polar\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"data\": [\n",
       "                1,\n",
       "                2,\n",
       "                3,\n",
       "                4,\n",
       "                3,\n",
       "                5,\n",
       "                1\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u54c1\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u54c1\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"radiusAxis\": {\n",
       "        \"type\": \"category\",\n",
       "        \"data\": [\n",
       "            \"\\u5468\\u4e00\",\n",
       "            \"\\u5468\\u4e8c\",\n",
       "            \"\\u5468\\u4e09\",\n",
       "            \"\\u5468\\u56db\",\n",
       "            \"\\u5468\\u4e94\",\n",
       "            \"\\u5468\\u516d\",\n",
       "            \"\\u5468\\u65e5\"\n",
       "        ],\n",
       "        \"scale\": false\n",
       "    },\n",
       "    \"angleAxis\": {\n",
       "        \"clockwise\": true,\n",
       "        \"max\": 10,\n",
       "        \"scale\": false,\n",
       "        \"splitNumber\": 5\n",
       "    },\n",
       "    \"polar\": {},\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u6781\\u5750\\u6807\\u56fe\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_3204203e56414e738a532e91304afbfa.setOption(option_3204203e56414e738a532e91304afbfa);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1a447cb2d00>"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = (\n",
    "    Polar()\n",
    "    .add_schema(\n",
    "        radiusaxis_opts=opts.RadiusAxisOpts(\n",
    "            data=Faker.week,\n",
    "            type_='category'\n",
    "        ),\n",
    "        angleaxis_opts=opts.AngleAxisOpts(\n",
    "            is_clockwise=True,\n",
    "            max_=10\n",
    "        )\n",
    "    )\n",
    "    .add('商品', [1, 2, 3, 4, 3, 5, 1], type_='bar')\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title='极坐标图'))\n",
    ")\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "b1a94a29",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"0a9061f9ab95456c9a018f60fb145f40\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_0a9061f9ab95456c9a018f60fb145f40 = echarts.init(\n",
       "                    document.getElementById('0a9061f9ab95456c9a018f60fb145f40'), 'white', {renderer: 'canvas'});\n",
       "                var option_0a9061f9ab95456c9a018f60fb145f40 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5546\\u54c1A\",\n",
       "            \"coordinateSystem\": \"polar\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"data\": [\n",
       "                1,\n",
       "                2,\n",
       "                3,\n",
       "                4,\n",
       "                3,\n",
       "                5,\n",
       "                1\n",
       "            ],\n",
       "            \"stack\": \"abc\",\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5546\\u54c1B\",\n",
       "            \"coordinateSystem\": \"polar\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"data\": [\n",
       "                2,\n",
       "                4,\n",
       "                3,\n",
       "                5,\n",
       "                2,\n",
       "                3,\n",
       "                1\n",
       "            ],\n",
       "            \"stack\": \"abc\",\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5546\\u54c1C\",\n",
       "            \"coordinateSystem\": \"polar\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"data\": [\n",
       "                1,\n",
       "                2,\n",
       "                3,\n",
       "                4,\n",
       "                3,\n",
       "                5,\n",
       "                1\n",
       "            ],\n",
       "            \"stack\": \"abc\",\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u54c1A\",\n",
       "                \"\\u5546\\u54c1B\",\n",
       "                \"\\u5546\\u54c1C\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u54c1A\": true,\n",
       "                \"\\u5546\\u54c1B\": true,\n",
       "                \"\\u5546\\u54c1C\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"radiusAxis\": {\n",
       "        \"scale\": false\n",
       "    },\n",
       "    \"angleAxis\": {\n",
       "        \"data\": [\n",
       "            \"\\u5468\\u4e00\",\n",
       "            \"\\u5468\\u4e8c\",\n",
       "            \"\\u5468\\u4e09\",\n",
       "            \"\\u5468\\u56db\",\n",
       "            \"\\u5468\\u4e94\",\n",
       "            \"\\u5468\\u516d\",\n",
       "            \"\\u5468\\u65e5\"\n",
       "        ],\n",
       "        \"clockwise\": false,\n",
       "        \"type\": \"category\",\n",
       "        \"scale\": false,\n",
       "        \"splitNumber\": 5\n",
       "    },\n",
       "    \"polar\": {},\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u6781\\u5750\\u6807\\u56fe+\\u5806\\u53e0\\u67f1\\u5f62\\u56fe\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_0a9061f9ab95456c9a018f60fb145f40.setOption(option_0a9061f9ab95456c9a018f60fb145f40);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1a447c384f0>"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = (\n",
    "    Polar()\n",
    "    .add_schema(\n",
    "#         radiusaxis_opts=opts.RadiusAxisOpts(\n",
    "#             data=Faker.week,\n",
    "#             type_='category'\n",
    "#         ),\n",
    "        angleaxis_opts=opts.AngleAxisOpts(\n",
    "            data=Faker.week,\n",
    "            type_='category'\n",
    "        ),\n",
    "    )\n",
    "    .add('商品A', [1, 2, 3, 4, 3, 5, 1], type_='bar', stack='abc')\n",
    "    .add('商品B', [2, 4, 3, 5, 2, 3, 1], type_='bar', stack='abc')\n",
    "    .add('商品C', [1, 2, 3, 4, 3, 5, 1], type_='bar', stack='abc')\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title='极坐标图+堆叠柱形图'))\n",
    ")\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "d8614ab4",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = [(i, random.randint(1, 100)) for i in range(10)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "fbae67d1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"4b1403c21caa48fd8670521d56780e9c\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_4b1403c21caa48fd8670521d56780e9c = echarts.init(\n",
       "                    document.getElementById('4b1403c21caa48fd8670521d56780e9c'), 'white', {renderer: 'canvas'});\n",
       "                var option_4b1403c21caa48fd8670521d56780e9c = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"effectScatter\",\n",
       "            \"name\": \"\\u6781\\u5750\\u6807\",\n",
       "            \"coordinateSystem\": \"polar\",\n",
       "            \"showEffectOn\": \"render\",\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 10,\n",
       "                \"period\": 1\n",
       "            },\n",
       "            \"symbolSize\": 4,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0,\n",
       "                    66\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    65\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    85\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    62\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    50\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    30\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    65\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    74\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u6781\\u5750\\u6807\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u6781\\u5750\\u6807\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"radiusAxis\": {\n",
       "        \"scale\": false\n",
       "    },\n",
       "    \"angleAxis\": {\n",
       "        \"clockwise\": false,\n",
       "        \"scale\": false,\n",
       "        \"splitNumber\": 5\n",
       "    },\n",
       "    \"polar\": {},\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u6781\\u5750\\u6807\\u56fe\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_4b1403c21caa48fd8670521d56780e9c.setOption(option_4b1403c21caa48fd8670521d56780e9c);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1a4481a4df0>"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = (\n",
    "    Polar()\n",
    "    .add(\n",
    "        '极坐标',\n",
    "        data,\n",
    "        type_='effectScatter',  # 涟漪散点图\n",
    "        effect_opts=opts.EffectOpts(\n",
    "            scale=10, # 涟漪范围大小\n",
    "            period=1,  # 动画周期\n",
    "        )\n",
    "    )\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title='极坐标图'))\n",
    ")\n",
    "c.render_notebook()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
